// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

/**
 * Enum for road types.
 */
enum class FWorldRoadKind
{
	Unknown,
	Rural,
	Motorway,
	Town,
	LowSpeed,
	Pedestrian,
	Bicycle
};

inline FWorldRoadKind FWorldRoadKindFromJson(const json& j)
{
	if (j == "unknown")		return FWorldRoadKind::Unknown;
	if (j == "rural")		return FWorldRoadKind::Rural;
	if (j == "motorway")	return FWorldRoadKind::Motorway;
	if (j == "town")		return FWorldRoadKind::Town;
	if (j == "lowSpeed")	return FWorldRoadKind::LowSpeed;
	if (j == "pedestrian")	return FWorldRoadKind::Pedestrian;
	if (j == "bicycle")		return FWorldRoadKind::Bicycle;
	return FWorldRoadKind::Unknown;
}

inline json FWorldRoadKindToJson(FWorldRoadKind p)
{
	if (p == FWorldRoadKind::Unknown)	return "unknown";
	if (p == FWorldRoadKind::Rural)		return "rural";
	if (p == FWorldRoadKind::Motorway)	return "motorway";
	if (p == FWorldRoadKind::Town)		return "town";
	if (p == FWorldRoadKind::LowSpeed)	return "lowSpeed";
	if (p == FWorldRoadKind::Pedestrian)return "pedestrian";
	if (p == FWorldRoadKind::Bicycle)	return "bicycle";
	return "unknown";
}

inline void from_json(const json& j, FWorldRoadKind& p)
{
	p = FWorldRoadKindFromJson(j);
}

inline void to_json(json& j, const FWorldRoadKind& p)
{
	j = FWorldRoadKindToJson(p);
}
